<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
    <title>index</title>
</head>
<body>
<h2></h2>


<a href="javaScript:void(0)" onclick="findById()">controller层加@Cacheable</a><br><br>
<a href="javaScript:void(0)" onclick="findById2()">service层加@Cacheable</a><br><br>


<a href="javaScript:void(0)" onclick="testAopAspect()">testAopAspect内部方法调用</a><br><br>
</body>

<script type="text/javascript">
    function findById() {
        var url = "${pageContext.request.contextPath}/user/findById.do";
        $.post(url, {id: 1}, function (data) {
            //alert(JSON.stringify(data));
            console.log(JSON.stringify(data));
        });
    }

    function findById2() {
        var url = "${pageContext.request.contextPath}/user/findById2.do";
        $.post(url, {id: 1}, function (data) {
            //alert(JSON.stringify(data));
            console.log(JSON.stringify(data));
        });
    }

    function testAopAspect() {
        var url = "${pageContext.request.contextPath}/user/testAopAspect.do";
        $.post(url, {id: 1}, function (data) {
            //alert(JSON.stringify(data));
            console.log(JSON.stringify(data));
        });
    }
</script>
</html>
